/*
 This file 'zdwxy_1' is part of Firebird Integrated Solution 1.0

 Copyright (c) 2020 Lincong

 Contact:  
        Email: lincong1987@gmail.com

        QQ: 159257119
 
 See Usage at http://www.jplatformx.com/firebird

 Create date: 2020-06-14 20:49
 */

define(function (require, exports, module) {

	require("../model/Chart");

	echarts.registerMap('china', require("../assets/map/json/china.json"))

	var ArrayUtils = require("../assets/ArrayUtils");

	var id = "zdwxy_1";

	Firebird.define(id, {
		extend: "Chart",
		setValue: function (data) {


			this.data = data = [
				{
					value: 45,
					name: "一级",
				}, {
					value: 12,
					name: "二级"
				}, {
					value: 12,
					name: "三级"
				}, {
					value: 12,
					name: "四级"
				}
			]

			var option = {

				color: [
					Chart.linearGradient('rgba(173, 45, 45, 1)', 'rgba(216, 74, 86, 1)'),
					Chart.linearGradient("rgba(201, 144, 74, 1)", "rgba(226, 195, 146, 1)"),
					Chart.linearGradient("rgba(70, 153, 97, 1)", "rgba(148, 193, 144, 1)"),
					Chart.linearGradient("rgba(59, 81, 255, 1)", "rgba(88, 138, 255, 1)")
				],

				title: {
					text: '2025',
					x: 'center',
					y: 'center',
					textStyle: {
						fontSize: 26,
						color: "rgba(82, 255, 253, 1)"
					}
				},

				grid: {
					bottom: 0,
					left: 16,
					right: 16
				},
				series: [
					// 数据圈
					{
						radius: [40, 80],
						center: ['50%', '50%'],
						type: 'pie',
						label: {
							width: 80,
							rich: {},
							normal: {
								show: true,
								formatter: "{b}\n{c}",
								color: "rgba(255, 255, 255, 1)",
								textStyle: {
									fontSize: 12,
								}, // position: 'outside'
							},
							emphasis: {
								show: true
							}
						},
						labelLine: {
							normal: {
								show: true, // length: 30,
								// length2: 55
							},
							emphasis: {
								show: true
							}
						},
						data: data.map(function (node, index) {
							return node;
						})

					},


				]

			};

			this.clear();
			this.setOption(option, !0);
		},
	});

	module.exports = Firebird.create(id, {id: id});
});